package com.example.mixview

import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.widget.ImageView
import android.widget.LinearLayout

class MainActivity : AppCompatActivity() {
    private var images = intArrayOf(R.drawable.hqsw,R.drawable.welt,R.drawable.xnylh)
    private var curimg = 0

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(R.layout.activity_main)

        var main = findViewById<LinearLayout>(R.id.root)
        var image = ImageView(this)
        main.addView(image)
        image.setImageResource(images[curimg])
        image.setOnClickListener {
            image.setImageResource(images[++curimg % images.size])
        }

    }
}